#include <stdio.h>
#include "common.h"

#ifndef _Exec
#define _Exec

/*
class TmpFile {

public:
	// temporary file name
	char *filename;

	// full path to a temporary file
	char *fullpath;

	// file handle of the created file
	FILE *file;

	// Constructor
	TmpFile();

	// Deconstructor
	~TmpFile();
};
*/

class Exec {

public:
/*	// temporary files for stdout & stderr
	TmpFile *oFile;
	TmpFile *eFile;
*/
	// access to standard output
	FILE *output;

	// buffer when reading off a line
	char buffer[DEFAULT_BUFLEN];

	// Constructor
	Exec(char* /*cmd*/);

	// Deconstructor
	~Exec();

	// whether or not there is output to parse
	bool isOutput();

	// reads off next line from stdout, removing \r\n
	char* getNext();
};

#endif	/* _Exec */